package inheritance;

public class Amimal {
    private String name;
    private String age;

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void eat(){
        System.out.println(name+"正在吃饭");


    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.setName("小环");
        dog.bark(dog.getName());
    }
}


class Dog extends Amimal{
    public void bark(String name){
        System.out.println(name+"正在叫");
    }
}

class Cat extends Amimal{
    public void catchMouse(String name){
        System.out.println(name+"正在抓老鼠");
    }
}